package com.benio.ycfdisplayer.fresco;

import android.graphics.Bitmap;
import android.graphics.drawable.Drawable;
import android.support.annotation.NonNull;
import android.view.View;

import com.benio.ycfdisplayer.displayer.ViewTarget;
import com.facebook.common.internal.Preconditions;

/**
 * 使用{@link com.facebook.drawee.backends.pipeline.Fresco}的{@link ViewTarget}
 * Created by zhangzhibin on 2016/9/1.
 */
abstract class FrescoViewTarget<V extends View> extends ViewTarget<V> implements FrescoView {

    public FrescoViewTarget(@NonNull V view) {
        super(view);
        Preconditions.checkNotNull(view);
    }

    @Override
    protected void setBitmapInto(Bitmap bitmap, V view) {
        // Nothing.
    }

    @Override
    protected void setDrawableInto(Drawable drawable, V view) {
        // Nothing.
        // Fresco使用自定义View时getTopLevelDrawable在View中调用
        // 不要在Target调用
    }
}
